package com.chushouya.manager.dto.admin.article;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.general.framework.core.enums.StatusEnum;
import com.general.framework.core.lang.Dates;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel("文章列表")
public class ArticleListDTO {

    /**
     * id
     */
    @ApiModelProperty(value = "articleId")
    private Long articleId;

    /**
     * 分类id
     */
    @ApiModelProperty(value = "分类id")
//    @JsonIgnore
    private Long categoryId;

    /**
     * 分类名称
     */
    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题")
    private String title;

    /**
     * 标题
     */
    @ApiModelProperty(value = "缩略图")
    private String image;

    /**
     * 简介
     */
    @ApiModelProperty(value = "简介")
    private String summary;
    /**
     * 是否显示
     */
    @ApiModelProperty(value = "状态")
    private Integer status;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sort;

    /**
     * 跳转类型
     */
    @ApiModelProperty(value = "跳转类型")
    private Integer routeType;

    /**
     * 跳转地址
     */
    @ApiModelProperty(value = "跳转地址")
    private String target;

    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间", example = "2022-01-01 12:00:00")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    public String getStatusText() {
        return StatusEnum.getDesc(this.status);
    }

}
